﻿@model List<Auction_Intranet.Models.InvitationModel>
@{
    ViewBag.Title = "Invitations";
}

<div class="page">
    <h2>Pending Invitations</h2>
    @Html.ActionLink("Back", "Index", "Dashboard", null, new { @class = "subpage-back", title="Back"})
    @foreach (var item in Model)
    {
        <section class="groups-invitations black-shadow-box">
            <aside class="groups-item-1 col3 groups-info">
                <span class="groups-item-text"><span class="groups-item-titles">Name:</span><span class="groups-item-data">@FileHelper.Truncate(item.invitation.Group.Name,20)</span></span><br />
                    <span class="groups-item-text"><span class="groups-item-titles">Balance:</span><span class="groups-item-data">@item.invitation.Group.Balance </span></span><br />
                    <span class="groups-item-text"><span class="groups-item-titles">Created:</span><span class="groups-item-data">@item.invitation.Group.Created.ToString("dd.MM.yyyy HH:mm")</span></span><br />
                    <span class="groups-item-text"><span class="groups-item-titles">Number of members:</span><span class="groups-item-data">@item.groupMembers.Count</span></span><br />
            </aside>
            <aside class="groups-item-2 col3 groups-info">
                    <span class="groups-members"><span class="groups-members-title">Members:</span> </span>
                    @foreach (var member in item.groupMembers)
                    {
                        <span class="groups-item-text">
                            <span class="groups-members-data">@FileHelper.Truncate(member.User.Username, 15) | added - @member.CreditAdded | spent - @member.CreditAddedSpent</span><br />
                        </span>                       
                    }
            </aside>
            <aside class="groups-item-3 col3">
                <span class="groups-item-text">
                    @Html.ActionLink("accept", "AcceptInvitation", new { id = item.invitation.Id }, new { title="Accept Invitation"}) | @Html.ActionLink("decline", "DeclineInvitation", new { id = item.invitation.Id }, new { title = "Decline Invitation" }) 
                </span>        
            </aside>                 
        </section>
    }
</div>